using System;
using System.Drawing.Printing;

namespace SpoolFileLibrary.Reader.Winspool {
    public class PaperSource {
        private readonly PaperSourceKind paperSourceKind;
        private readonly short paperSourceValue;

        public PaperSource(short value) {
            this.paperSourceValue = value;
            if(value >= 0x00000100) {
                this.paperSourceKind = PaperSourceKind.Custom;
                return;
            }
            if(!Enum.IsDefined(typeof(PaperSourceKind), (int) value)) {
                this.paperSourceKind = PaperSourceKind.Custom;
                return;
            }
            this.paperSourceKind = (PaperSourceKind) value;
            return;
        }

        public PaperSourceKind PaperSourceKind {
            get { return this.paperSourceKind; }
        }

        public short PaperSourceValue {
            get { return this.paperSourceValue; }
        }
    }
}